#ifndef CPIR_COMMON_H
#define CPIR_COMMON_H

//   Copyright 2011 CPIR Team
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.


//   1-2 Oblivious Transfer Procedure:
//   -----------------------------------------------------------------
//    Step |  Alice                    |    |  Bob
//   -----------------------------------------------------------------
//      1  |  m_0, m_1, ...            |    |
//      2  |  RSA Key: d, N&e          | => |  N&e
//      3  |  x_0, x_1, ...            | => |  x_0, x_1, ...
//      4  |                           |    |  k, b, x_b
//      5  |  v                        | <= |  v = (x_b + k^e) mod N
//      6  |  k_n = (v - x_n)^d mod N  |    |
//      7  |  m_n' = m_n + k_n         | => |  m_0', m_1', ...
//      8  |                           |    |  m_b = m_b' - k
//   -----------------------------------------------------------------
//    Reference: en.wikipedia.org/wiki/Oblivious_transfer

typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef long long int64_t;

typedef unsigned long long uint64_t;
typedef int32_t key_t;
typedef int32_t msg_t;
typedef int32_t cmsg_t;

class Serialization;
class ISerializable;

class Message;
class CipherMessage;
class MessageCollection;
class CipherMessageCollection;
class ServerPublicKey;
class ClientKey;


#endif
